package org.example.aienglishapp.mapper.speech.userrecording;

import org.example.aienglishapp.entity.speech.userrecording.UserRecording;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserRecordingMapper {

    int insertUserRecording(UserRecording userRecording);

    void updateUserRecording(UserRecording userRecording);

    UserRecording getUserRecordingByUserIdAndSentenceId(Long userId, Long sentenceId);

    List<UserRecording> getUserRecordingByUserId(Long userId);

    // 新增的方法，用于根据 chapterId 获取用户录音记录
    List<UserRecording> getUserRecordingsByChapterId(Long chapterId);

    // 修改的方法，用于根据 chapterId 和 userId 获取用户录音记录
    List<UserRecording> getUserRecordingByUserIdAndChapterId(Map<String, Long> params);

    // 新增的方法，用于获取序列值
    Long getRecordingSequence();
}
